package com.zixuan.gulicollege.msmservice.config;

import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

/**
 * @ClassName MsmConfig
 * @Author by zixuan
 * @Date 2021/5/18 19:07
 */

@Component
public class MsmConfig implements InitializingBean {

    @Value("${phone-code.app-code}")
    private String appCode;

    @Value("${phone-code.host}")
    private String host;

    @Value("${phone-code.path}")
    private String path;

    @Value("${phone-code.method}")
    private String method;

    @Value("${phone-code.template-id}")
    private String templateId;

    @Value("${phone-code.expire-at}")
    private String expireAt;

    public static String APP_CODE;

    public static String HOST;

    public static String PATH;

    public static String METHOD;

    public static String TEMPLATE_ID;

    public static String EXPIRE_AT;


    @Override
    public void afterPropertiesSet() throws Exception {
        APP_CODE = this.appCode;
        HOST = this.host;
        PATH = this.path;
        METHOD = this.method;
        TEMPLATE_ID = this.templateId;
        EXPIRE_AT = this.expireAt;
    }
}
